cmake_minimum_required(VERSION 3.30.5)

add_library(native-lib SHARED native-lib.cpp)

add_library(native-egl-lib SHARED native-egl-lib.cpp)

# 查找所需的库
find_library(log-lib log)               # __android_log_print函数  
find_library(gles-lib GLESv1_CM)        # 添加对native_window的链接
find_library(gles2-lib GLESv2)
find_library(egl-lib EGL)

# 链接 log 库
# ANativeWindow_fromSurface 需要连接android.so
target_link_libraries(native-lib ${log-lib})
target_link_libraries(native-egl-lib android.so ${log-lib} ${gles-lib} ${gles2-lib} ${egl-lib})
